package Test;

public class GirlFriend {
    private String name;
    private int age;

    public GirlFriend(){}

    public GirlFriend(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (name.length()<=4) {
            this.name = name;
        }else {
            throw new RuntimeException();
        }
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age >= 18&&age <= 40) {
            this.age = age;
        }else {
            throw  new RuntimeException();
        }
    }
}
